package api02a;

import java.util.LinkedList;

public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.addFirst(5);
        list.addLast(6);
        System.out.println("list:"+list);

        int first = list.getFirst();
        int last = list.getLast();
        System.out.println("first:"+first+",last:"+last);

        list.removeLast();
        list.removeFirst();

    }
}
